import request from '@/utils/request'

// 查询车辆使用记录列表
export function listLifeCarUsageRecord(query) {
  return request({
    url: '/mes/life/lifeCarUsageRecord/list',
    method: 'get',
    params: query
  });
}

// 查询车辆使用记录详细
export function getLifeCarUsageRecord(id) {
  return request({
    url: '/mes/life/lifeCarUsageRecord/' + id,
    method: 'get'
  });
}

// 新增车辆使用记录
export function addLifeCarUsageRecord(data) {
  return request({
    url: '/mes/life/lifeCarUsageRecord',
    method: 'post',
    data: data
  });
}

// 修改车辆使用记录
export function updateLifeCarUsageRecord(data) {
  return request({
    url: '/mes/life/lifeCarUsageRecord',
    method: 'put',
    data: data
  });
}

// 删除车辆使用记录
export function delLifeCarUsageRecord(id) {
  return request({
    url: '/mes/life/lifeCarUsageRecord/' + id,
    method: 'delete'
  }); 
}

// 结束用车
export function endUseLifeCarUsageRecord(username) {
  return request({
    url: '/mes/life/lifeCarUsageRecord/endUse/' + username,
    method: 'put'
  });
}
